﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SystemManagement.Dto
{
    /// <summary>
    /// 菜单节点
    /// </summary>
    public class MenuNode
    {
        #region Properties

        /// <summary>
        /// 菜单ID
        /// </summary>
        public long ID { get; set; }

        /// <summary>
        /// 父菜单ID
        /// </summary>
        public long? ParentId { get; set; }

        /// <summary>
        /// 菜单名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 菜单级别
        /// </summary>
        public int Levels { get; set; }

        /// <summary>
        /// 是否是菜单（菜单还是按钮）
        /// </summary>
        public bool IsMenu { get; set; }

        /// <summary>
        /// 是否菜单
        /// </summary>
        public string IsMenuName => this.IsMenu ? "是" : "否";

        /// <summary>
        /// 菜单状态
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 菜单状态
        /// </summary>
        public string StatusName => this.Status == 1 ? "启用" : "禁用";

        /// <summary>
        /// 排序
        /// </summary>
        public int Num { get; set; }

        /// <summary>
        /// 菜单URL
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// 菜单路径
        /// </summary>
        public string Path { get; set; }

        /// <summary>
        /// 菜单图标
        /// </summary>
        public string Icon { get; set; }

        /// <summary>
        /// 菜单编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 父菜单编码
        /// </summary>
        public string PCode { get; set; }

        /// <summary>
        /// 菜单对饮视图组件
        /// </summary>
        public string Component { get; set; }

        /// <summary>
        /// 是否隐藏
        /// </summary>
        public bool Hidden { get; set; }

        /// <summary>
        /// 子菜单
        /// </summary>
        public List<MenuNode> Children { get; private set; } = new List<MenuNode>();

        #endregion
    }
}
